<?php
/**
 * Setting::settings view
 */
/**
 * @var Setting[] $settings
 * @var CActiveForm $form
 */
 
function resolveName($model, $attribute) {
	$id = $model->name;
	
	return "Setting[$id][$attribute]"; 
}
?>

<div class="form">
<?php
	$valueField = 'value'; 
	$form = $this->beginWidget('GxActiveForm', array(
	'id' => 'setting-form',
	'enableAjaxValidation' => false,
));
?>
<?php foreach ($settings as $setting): ?>
	<?php echo CHtml::hiddenField(resolveName($setting, 'id'),$setting->id); ?>
	<div class="row">
	<?php echo CHtml::label($setting->name, resolveName($setting, 'value')) ?>
	<?php echo CHtml::textField(resolveName($setting, 'value'), $setting->value); ?>
	<?php echo $form->error($setting,'value'); ?>
	</div><!-- row -->
<?php endforeach ?>
<?php
echo GxHtml::submitButton(Yii::t('app', 'Save'));
$this->endWidget();
?>

</div><!-- form -->